package com.woniuxy.commen;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class ConnUtils {

    public static Channel getconn(){
        try{
            ConnectionFactory cf = new ConnectionFactory();
            cf.setHost("localhost");
            cf.setPort(5672);
            Connection connection = cf.newConnection();

            return connection.createChannel();
        }catch (Exception e) {
            throw new  RuntimeException(e);
        }

    }

}
